package lancs.mobilemedia.core.ui.controller.commands;

import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.List;

import lancs.mobilemedia.core.ui.controller.AbstractController;
import lancs.mobilemedia.core.ui.controller.ControllerCommand;
import lancs.mobilemedia.core.ui.controller.PhotoListController;
import lancs.mobilemedia.core.ui.controller.ScreenSingleton;
import lancs.mobilemedia.core.util.Constants;

public class SelectAlbum implements ControllerCommand {

	public boolean execute(AbstractController controller) {
		List down = (List) Display.getDisplay(controller.getMidlet()).getCurrent();
		ScreenSingleton.getInstance().setCurrentStoreName(down.getString(down.getSelectedIndex()));
		((PhotoListController) controller).showImageList(ScreenSingleton.getInstance().getCurrentStoreName(), false, false);
		ScreenSingleton.getInstance().setCurrentScreenName(Constants.IMAGELIST_SCREEN);
		return true;
	}
}
